﻿@model IEnumerable<verk2013_project_group12.Models.Game>

@section JavaScript
{
     <script src="@Url.Content("~/Scripts/Script.js")" type="text/javascript"></script>
}

@{
    ViewBag.Title = "Start a new game";
}

<h2>Start a new game</h2>

<div>
    <p>Game: </p>
</div>


@using (@Html.BeginForm())
{

<form method="post" action="check.php">

   <select class="boxItem" name="gameID">
    <option>Select game</option>
@foreach (var game in Model)
{  
    <option value="@game.ID" id="@game.Name" >@game.Name</option>
}
</select>

<div class="hide">
    @foreach (var game in Model)
{
        <div class="@game.Name">
            <p>Number of players: </p>

            <select name="@game.ID">
               @for (int i = game.MinPlayers; i <= game.MaxPlayers; i++)
               {
                   <option>@i</option>
               }
            </select>

        </div>
  }    
  </div>

    <div class="insertForm">
    <p>Number of players: </p>
    <select>
        <option>Please select a game first</option>
</select>
       </div>
    <INPUT TYPE="submit" name="submit" value="Start New Game" />
</form>
	
	 
}